<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>资金申请管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }

	</script>
	<script type="text/javascript">
        $(function () {
            $("select").each(function (i, n) {
                var options = "";
                $(n).find("option").each(function (j, m) {
                    if (options.indexOf($(m)[0].outerHTML) == -1) {
                        options += $(m)[0].outerHTML;
                    }
                });
                $(n).html(options);
            });
        });
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/campusinfocompany/campusinfoFundReq/">资金申请列表</a></li>
		<shiro:hasPermission name="campusinfocompany:campusinfoFundReq:edit"><li><a href="${ctx}/campusinfocompany/campusinfoFundReq/form">资金申请添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="campusinfoFundReq" action="${ctx}/campusinfocompany/campusinfoFundReq/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>公司名称：</label>
				<form:select path="companyId" class="input-medium">
					<form:option value="" label=""/>oo
					<form:options items="${campusinfoFundReqs}" itemLabel="companyName" itemValue="companyId" htmlEscape="false"/>
				</form:select>
			</li>
			<%--<li><label>申请类型：</label>--%>
				<%--<form:input path="reqType" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
			<%--</li>--%>
			<li><label>申请金额：</label>
				<form:input path="reqFunds" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>申请用途：</label>
				<form:input path="reqPurpose" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>状态：</label>
				<form:select path="reqStatus" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('company')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>公司名称</th>
				<th>申请用户</th>
				<th>申请金额</th>
				<th>申请用途</th>
				<th>审核意见</th>
				<th>发放资金</th>
				<th>状态</th>
				<shiro:hasPermission name="campusinfocompany:campusinfoFundReq:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="campusinfoFundReq">
			<tr>
				<td><a href="${ctx}/campusinfocompany/campusinfoFundReq/form?id=${campusinfoFundReq.id}">
					${campusinfoFundReq.companyName}
				</a></td>
				<td>
					${campusinfoFundReq.user.name}
				</td>
				<td>
					${campusinfoFundReq.reqFunds}
				</td>
				<td>
					${campusinfoFundReq.reqPurpose}
				</td>
				<td>${campusinfoFundReq.reqReply}
				</td>
				<td>${campusinfoFundReq.providefund}
				</td>
				<td>
					${fns:getDictLabel(campusinfoFundReq.reqStatus, 'company',campusinfoFundReq.id)}
				</td>
				<shiro:hasPermission name="campusinfocompany:campusinfoFundReq:edit"><td>
					<a href="${ctx}/campusinfocompany/campusinfoFundReq/form?id=${campusinfoFundReq.id}">审核意见</a>
					<c:if test="${campusinfoFundReq.reqStatus =='1'}">
						<a href="${ctx}/campusinfocompany/campusinfoFundReq/status?id=${campusinfoFundReq.id}">审核</a>
					</c:if>
					<c:if test="${campusinfoFundReq.reqStatus =='2'}">
						<a href="${ctx}/campusinfocompany/campusinfoFundReq/cashier?id=${campusinfoFundReq.id}">出纳</a>
						<!-- Button trigger modal -->
						<%--<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">--%>
							<%--出纳--%>
						<%--</button>--%>
						<%--<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">--%>
							<%--<div class="modal-dialog" role="document">--%>
								<%--<div class="modal-content">--%>
									<%--<div class="modal-header">--%>
										<%--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>--%>
										<%--<h4 class="modal-title" id="myModalLabel">发放金额</h4>--%>
									<%--</div>--%>
									<%--<div class="modal-body">--%>
										<%--<input type="text" htmlEscape="false" maxlength="64"  id="providefund",placeholder="请输入发放金额" class="input-medium"/> 元--%>
										<%--&lt;%&ndash;<form:input htmlEscape="false" maxlength="64" class="input-medium"/>&ndash;%&gt;--%>
									<%--</div>--%>
									<%--<div class="modal-footer">--%>
										<%--<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>--%>
										<%--<a href="${ctx}/campusinfocompany/campusinfoFundReq/cashier? providefund=$('#providefund').value),id=${campusinfoFundReq.id}">确定</a>--%>
									<%--</div>--%>
								<%--</div>--%>
							<%--</div>--%>
						<%--</div>--%>
					</c:if>
					<a href="${ctx}/campusinfocompany/campusinfoFundReq/delete?id=${campusinfoFundReq.id}" onclick="return confirmx('确认要删除该资金申请吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>